﻿using System.Collections.Generic;
using hello.csharp.controller;
using hello.csharp.controller.authority;
using hello.csharp.controller.recommend;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Swagger;
using Swashbuckle.AspNetCore.SwaggerGen;

namespace hello.csharp.zone.Swaggers
{
    /// <summary>
    /// 添加控制器模块说明
    /// </summary>
    public class ApplyTagDescriptions : IDocumentFilter
    {
        /// <summary>
        /// apply
        /// </summary>
        /// <param name="swaggerDoc"></param>
        /// <param name="context"></param>
        public void Apply(SwaggerDocument swaggerDoc, DocumentFilterContext context)
        {
            swaggerDoc.Tags = new List<Tag>
            {
                new Tag { Name = $"{nameof(AccountController).Replace(nameof(Controller),"")}", Description = "权限" },
                new Tag { Name = $"{nameof(RecommendController).Replace(nameof(Controller),"")}", Description = "推荐" },
                new Tag { Name = $"{nameof(SampleController).Replace(nameof(Controller),"")}", Description = "API样例测试" },
            };
        }
    }
}
